package com.tong.hao.ac.service.controller.finance;

import cn.buddha.jec.flowable.FlowableExecute;
import cn.buddha.jec.util.TongUtils;
import com.tong.hao.ac.api.model.in.finance.AC010001Req;
import com.tong.hao.ac.api.model.out.finance.AC010001Res;
import com.tong.hao.ac.api.service.finance.IAC010001;
import com.tong.hao.ac.service.flowable.finance.AcBillFlowable;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName AC010001
 * @Author 友野浩二
 * @Date 2020/4/26 17:22
 * @Description 账单 API
 * @Version 1.0
 */
@Api(tags = "账单")
@RestController
@Slf4j
public class AC010001 implements IAC010001 {

    /**
     * 服务流程启动类
     */
    @Resource
    private FlowableExecute flowableExecute;

    @ApiOperation(value = "记账")
    @RequestMapping(value = TONG_HAO_AC_01_0001, method = RequestMethod.POST)
    @Override
    public AC010001Res recordBill(@RequestBody AC010001Req ac010001Req) {
        return this.flowableExecute.start(TongUtils.lowerFistChar(AcBillFlowable.class.getSimpleName()), ac010001Req);
    }
}
